/**
 * Created by tiansha on 2016/4/24.
 */

const UPLOAD = 'employees/UPLOAD';
const UPLOAD_SUCCESS = 'employees/UPLOAD_SUCCESS';
const UPLOAD_FAIL = 'employees/UPLOAD_FAIL';

const initialState = {

};

export default function uploadReducer(state = initialState, action = null) {
  switch (action.type) {
    case UPLOAD_SUCCESS:
      return {
        ...state
      };
    default:
      return state;
  }
}

export function uploadImages(formData) {
  return  {
    types: [UPLOAD, UPLOAD_SUCCESS, UPLOAD_FAIL],
    promise: client => client.post('/api/upload', formData)
  };
}
